// components/banner/banner.js
const app = getApp();
Component({

  /**
   * 组件的属性列表
   */
  properties: {

  },

  /**
   * 组件的初始数据
   */
  data: {
    banners: [],
  },

  /**
   * 组件的方法列表
   */
  methods: {
    getBanners() {
      wx.request({
        url: `${app.globalData.baseUrl}/banner/list?pageNum=1&pageSize=100`,
        method: 'GET',
        success: (res) => {
          this.setData({ banners: res.data.rows });
        }
      });
    }
  },
  lifetimes: {
    attached() {
      this.getBanners();
    }
  }
})